#if UNITY_EDITOR

using UnityEditor;
using UnityEngine;

namespace JH
{
    public static class CopyGameObjectPath 
    {
        [MenuItem("GameObject/复制路径")]
        static void CopyPath()
        {
            GameObject selectedObject = Selection.activeGameObject;
            if (selectedObject == null)
            {
                Debug.LogWarning("没有选中任何游戏对象！");
                return;
            }

            string path = selectedObject.transform.GetRootPathStringEm(true);
            GUIUtility.systemCopyBuffer = path;
            Debug.Log($"已复制路径到剪贴板: {path}");
        }
    
    }
}
#endif